/*
Directory.h
*/

#ifndef Directory_h
#define Directory_h

#include <map>
#include <string>

#include "File.h"

using namespace std;

class FileSystem;

/*
Directories are a type of File.
*/
class Directory : public File{
    friend class FileSystem;

    public:
        Directory(FileSystem * fs_loc,unsigned int inode_id_loc);

        int CdChildDirectory(string name);
        File * GetChildFile(string name);

        int AddEntry(string name, unsigned int inode_id);
        int RemoveEntry(string name);
    private:
        void populate_entries(); //fills entries, called when created and when cd to a child dir
        map <string, unsigned int> entries; //key = filename, val = inode number
};

#endif
